import { Space, Button } from 'antd';

export const fields = [
    {
        type: 'input',
        label: '学校',
        key: 'schoolNname',
        name: 'schoolNname',
        required: true
    },
    {
        type: 'input',
        label: '学校1',
        key: 'schoolNname1',
        name: 'schoolNname1',
        required: true
    },
    {
        type: 'input',
        label: '学校2',
        key: 'schoolNname2',
        name: 'schoolNname2',
        required: true
    },
    {
        type: 'input',
        label: '学校3',
        key: 'schoolNname3',
        name: 'schoolNname3',
        required: true
    },
    {
        type: 'select',
        label: '院系',
        key: 'faculty',
        name: 'faculty',
        option: [
            {
                value: 1,
                name: '计算机学院'
            },
            {
                value: 2,
                name: '国际商务学院'
            }
        ]
    },
    {
        type: 'select',
        label: '专业',
        key: 'major',
        name: 'major',
        option: [
            {
                value: 1,
                name: '软件工程'
            },
            {
                value: 2,
                name: '国际商务英语'
            }
        ]
    },
]

export const columns = [
    {
        title: '学校',
        dataIndex: 'schoolNname',
        key: 'schoolNname',
        render: (text) => <a>{text}</a>,
    },
    {
        title: '院系',
        dataIndex: 'faculty',
        key: 'faculty',
    },
    {
        title: '专业',
        key: 'major',
        dataIndex: 'major'
    },
    {
        title: '操作',
        key: 'operation',
        dataIndex: 'operation',
        width: 250,
        render: (_, record) => (
            <Space size="middle">
                <Button type="primary" size={'small'} onClick={() => edit(record)}>编辑</Button>
                <Button size={'small'} onClick={() => del(record)}>删除</Button>
            </Space>
        )
    },
];

const del = (record) => {
    console.log(record);
}

const edit = (record) => {
    console.log(record);
}